package com.dg.common;

public class Const {

    public enum StatusEnum{
        //状态，1：正常，0：冻结状态
        Effective(1,"正常"),
        Frozen(0,"冻结");

        StatusEnum(int code,String value){
            this.code = code;
            this.value = value;
        }
        private String value;
        private int code;

        public String getValue() {
            return value;
        }

        public int getCode() {
            return code;
        }

        public static StatusEnum codeOf(int code){
            for(StatusEnum statusEnum : values()){
                if(statusEnum.getCode() == code){
                    return statusEnum;
                }
            }
            throw new RuntimeException("没有找到对应的枚举");
        }
    }


    public enum AclTypeEnum{
        ////类型，1：菜单，2：按钮，3：其他
        MENU(1, "菜单"),
        BUTTON(2, "按钮"),
        OTHER(3, "其它");

        AclTypeEnum(int code,String value){
            this.code = code;
            this.value = value;
        }
        private String value;
        private int code;

        public String getValue() {
            return value;
        }

        public int getCode() {
            return code;
        }

        public static AclTypeEnum codeOf(int code){
            for(AclTypeEnum aclTypeEnum : values()){
                if(aclTypeEnum.getCode() == code){
                    return aclTypeEnum;
                }
            }
            throw new RuntimeException("没有找到对应的枚举");
        }
    }



}
